{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "ename": "ModuleNotFoundError",
     "evalue": "No module named 'source'",
     "output_type": "error",
     "traceback": [
      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[0;31mModuleNotFoundError\u001b[0m                       Traceback (most recent call last)",
      "\u001b[0;32m<ipython-input-1-e149f0745150>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[1;32m     21\u001b[0m \u001b[0;32mimport\u001b[0m \u001b[0mmatplotlib\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mpatches\u001b[0m \u001b[0;32mas\u001b[0m \u001b[0mpatches\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m     22\u001b[0m \u001b[0;32mimport\u001b[0m \u001b[0mtime\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 23\u001b[0;31m \u001b[0;32mfrom\u001b[0m \u001b[0msource\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mutils\u001b[0m \u001b[0;32mimport\u001b[0m \u001b[0mload_tracklets_for_frames\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mpoint_inside\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0min_hull\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m     24\u001b[0m \u001b[0;32mfrom\u001b[0m \u001b[0msource\u001b[0m \u001b[0;32mimport\u001b[0m \u001b[0mparseTrackletXML\u001b[0m \u001b[0;32mas\u001b[0m \u001b[0mxmlParser\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m     25\u001b[0m \u001b[0;32mfrom\u001b[0m \u001b[0msource\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mkitti_util\u001b[0m \u001b[0;32mimport\u001b[0m \u001b[0;34m*\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;31mModuleNotFoundError\u001b[0m: No module named 'source'"
     ]
    }
   ],
   "source": [
    "import sys\n",
    "KITTI_ROOT_PATH = '/home/ruizhu/Documents/Datasets/kitti'\n",
    "sys.path.append(KITTI_ROOT_PATH+'/kitti-lidar-utils')\n",
    "sys.path.append(KITTI_ROOT_PATH+'/kitti-lidar-utils/source')\n",
    "sys.path.append(KITTI_ROOT_PATH+'/depth/devkit/python')\n",
    "\n",
    "import numpy as np\n",
    "np.set_printoptions(precision=4, suppress=True)\n",
    "\n",
    "%reload_ext autoreload\n",
    "%autoreload 2\n",
    "\n",
    "from scipy.io import savemat\n",
    "import itertools\n",
    "import pdb\n",
    "import os\n",
    "from PIL import Image, ImageOps\n",
    "import imageio\n",
    "%matplotlib inline\n",
    "import matplotlib.pyplot as plt\n",
    "import matplotlib.patches as patches\n",
    "import time\n",
    "from source.utils import load_tracklets_for_frames, point_inside, in_hull\n",
    "from source import parseTrackletXML as xmlParser\n",
    "from source.kitti_util import *\n",
    "import argparse\n",
    "from matplotlib import cm\n",
    "from math import atan2, degrees\n",
    "from PIL import Image\n",
    "from read_depth import *\n",
    "from IPython.core.display import display, HTML\n",
    "display(HTML(\"<style>.container { width:90% !important; }</style>\"))\n",
    "import torch\n",
    "\n",
    "import dsac_tools.utils_F as utils_F\n",
    "import dsac_tools.utils_geo as utils_geo\n",
    "import dsac_tools.utils_misc as utils_misc\n",
    "import dsac_tools.utils_vis as utils_vis\n",
    "import dsac_tools.utils_opencv as utils_opencv\n",
    "from dsac_tools.H_loss import HLoss\n",
    "from dsac_tools.dsac import DSAC\n",
    "\n",
    "from kitti_tools.utils_kitti import *\n",
    "kitti_two_frame_loader = KittiLoader(KITTI_ROOT_PATH)\n",
    "\n",
    "## Select sequence\n",
    "date_name = '2011_09_26'\n",
    "seq_name = '0001'\n",
    "\n",
    "kitti_two_frame_loader.set_drive(date_name, seq_name)\n",
    "kitti_two_frame_loader.get_left_right_gt()\n",
    "kitti_two_frame_loader.load_cam_poses()\n",
    "# kitti_two_frame_loader.show_demo()\n",
    "kitti_two_frame_loader.rectify_all(visualize=False)\n",
    "\n",
    "## Help functions and plot params\n",
    "fig_scale = 300\n",
    "fig_ratio = [4, 3]\n",
    "im_shape = kitti_two_frame_loader.im_shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "## Get two frames"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "py36_pytorch",
   "language": "python",
   "name": "py36_pytorch"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.7"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
